package com.hp.webfluxclient.api;


import com.hp.webfluxclient.entity.User;
import dong.annoaction.ApiServer;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author dongxing
 **/
@ApiServer("http://localhost:8080/user")
public interface IUserApi {

    @GetMapping("/")
    Flux<User> findAllUser();


    @GetMapping("/{id}")
    Mono<User> getUserById(@PathVariable("id") String id);


    @DeleteMapping("/{id}")
    Mono<Void> delById(@PathVariable("id") String id);


    @PostMapping("/")
    Mono<User> createUser(@RequestBody Mono<User> user);
}
